Expanding SNES pointer tables from 2-byte to 3-byte Well, first you're going to need to find out if the text routine itself is using absolute (2-byte) or long (3-byte) addressing mode to read your script. So, use tracing to find out where your script is being read from. Say it's 81:2345. Say you find out the instuction is like LDA [$67],Y [$81:2345] Note the [] indicates "long" addressing mode, where the ROM bank is read along with the address. This instruction means a 3-byte pointer to the text is stored at RAM offset $67-69 (+ the value of the D register, in the bank in the DB register). So if D=0400 and DB=7E, then pointer would be stored at 7E:0467. If the instruction is LDA ($67),Y with the () brackets, that means it's only reading a 2-byte pointer at $67-68, and looking at the DB bank. So, if DB=80, D=0400 and $80:0467=9512, then it's reading $80:0467 (which is a RAM mirror), and will read the script from $80:9512. How you will go about changing the pointer depends on which method the game originally uses. --------------------------------- LONG ADDRESSING (3-byte pointers) --------------------------------- This is the easier one to change. Most likely the game is doing something like this to initialize the pointer. ;let's say the game is using a 16-bit accumulator LDA $12 ;string number -> acc. ASL A ;shift acc. once, doubling the value because pointers are 2 bytes TAX ;acc. -> X LDA $9512,X ;pointer table at offset $9512 in current bank, X = offset into table STA $67 ;offset stored to $67-68. Say it's $ACDE LDA #$0080 ;hard-coded bank value STA $69 RestOfCode: ... Now the pointer is set to $80:ACDE. So, to change that, let's just replace the routine. Make a jump to somewhere else in ROM. It's easiest to just use xkas for this. Say our original pointer routine was at ROM address $80:8100, and it's a LoROM. We would write code like this: lorom org $808100 JMP ReplacedPointerLoad ;use a JMP if you plan to place the code in the same bank ;use a JML if you're going to place the code in another bank org $80FF00 ;say we have some free space at $80:FF00 ReplacedPointerLoad: LDA $12 ;load our string number ASL A ;double A CLC ADC $12 ;this is effectively ($12 * 2) + $12 = $12 * 3 ; we want to do this because we're expanding the pointer table (hopefully, immediately following was the ; text we were going to repoint anyway, or empty data. Otherwise you'll have a problem if you're overwriting ; data that was still needed.) to 3 bytes per pointer TAX ;X = index into pointer table LDA $9512,X ;low bytes of pointer table (again, if we're using a 16-bit A) STA $67 ;if using an 8-bit A, read $9513,X and store to $68 LDA $9514,X ;read bank value STA $69 ;this will store the bank to $69 and assumes $6A is junk data. If you need to save $6A's value ;switch A to 8-bit before writing to $69 with a SEP #$20 instruction. JMP RestOfCode ;again, replace with JML if your new code is in a different bank than the original Variants I've seen are like Breath of Fire II, which loads the bank value of the first dialouge bank, then checks the string number being printed, and increments the bank as it exceeds certain hard-coded values. ------------------------------------- ABSOLUTE ADDRESSING (2-byte pointers) ------------------------------------- Again, this is going to be trickier. It will also require you have 3 contiguous bytes in whatever page DB:D is pointing to. (say if DB=80 and D=0400, you'll need 3 contiguous bytes free between 80:0400 and 80:04FF (within $100 bytes after D).) For simplicity, let's just say the game was using $67-68 to store the pointer and $69-6A is also free) So, just load your initial pointer in the same way as above. Then replace the line reading the script, such as LDA ($67),Y with a long addressing instruction such as LDA [$67],Y If you don't have 3 bytes available, then you're going to have do something more difficult. Store your initial pointer to somewhere in free RAM, like 7F:FFF0 Push a few bytes, like LDA $67 ;store the original data, again assuming 16-bit acc. PHA LDA $69 PHA ; now load in your pointer LDA $7FFFF0 STA $67 LDA $7FFFF2 STA $69 ;now read your pointer LDA [$67] STA $7FFFF4 ;store the value you read somewhere in free RAM ;now restore the original data, remember when pulling data off the stack it needs to be stored in reverse order PLA STA $69 PLA STA $67 LDA $7FFFF4 ;reload the script data you stored Note you will probably have to hack the dialouge pointer adjusting routine to update your custom pointer.